/**
 * Created by XHL on 2022-07-26.
 */

#ifndef MOVE_TEST_TANK_H
#define MOVE_TEST_TANK_H
#pragma once

#include <Environment.h>
#include <common.h>
#include <GameObject.h>

using namespace meta;

namespace entity {
	class Tank : public Environment, public GameObject {
	public:
		explicit Tank(const PInfo &info);

		// void display_self() const;

		void try_to_move(const int &ascii);

		void response() override;

		[[nodiscard]] bool is_movable() const &;

		void set_movable(const bool &movable);

		[[nodiscard]] const Location &get_location() const;

	public:
		[[nodiscard]] const PInfo &get_info() const;

		void set_hp(int hp);

		[[nodiscard]] const int &get_hp() const;

		void notify();

	private:
		//ListenFunc move_to;
		bool m_movable;

		Environment *e_game;
		Environment *e_map;
		Environment *e_opponent;
	public:

		void set_game(Environment *eGame);

		void set_map(Environment *eMap);

		void set_opponent(Environment *eOpponent);

	private:

		void erase_self() const;

		void print_message(const int &key) const;
	};
}

#endif //MOVE_TEST_TANK_H
